<!--{include(file='selhead.html')}-->
<div class="main_c" style="padding-top:10px;">
	<form name="seaform" id="seaform" action="<!--{url('admin','select','selectitem','type=$type')}-->" method="post">
		<div class="bt_bk">
			<span class="search_bk"><input type="text" class="input_tx" name="q" id="q" value="<!--{$q}-->"/>
			<input type="button" value="搜索" class="input_bt" onclick="$.oper.seasubmit('sea')"/></span>
			<span class="state_tip"></span>
		</div>
		<input type="hidden" value="<!--{def($pagearr['page'],1)}-->"		name="page" id="page"/>
		<input type="hidden" value="<!--{def($pagearr['pagesize'],5)}-->"	name="pagesize" id="pagesize" />
	</form>
		<table class="tableStyle" border="0" cellspacing="0" cellpadding="0">
			<thead>
				<tr align="center">
					<th width="10%">编号</th>
					<th width="300" colspan="2">商品</th>
					<th width="20%">价格(￥)</th>
					<th width="10%">库存</th>
					<th width="10%">选择</th>
				</tr>
			</thead>
			<tbody id="listtbody">
				<!--{if $items}-->
					<!--{foreach $items item}-->
					<tr align="center" id="tr_<!--{$item.itemid}-->">
						<td><!--{$item.itemid}--></td>
						<td id="img_<!--{$item.itemid}-->">
							<a href="<!--{url('index','item','index','itemid=$item.itemid')}-->" target="_blank">
							<img src = "<!--{$item.itemimg}-->_50x50.jpg" width="50" height="50" onerror="this.onerror='',this.src='images/nopicture.jpg'"  class="mid"/>
							</a>
						</td>
						<td  align="left" id="item_<!--{$item.itemid}-->">
							<a href="<!--{url('index','item','index','itemid=$item.itemid')}-->" target="_blank"><!--{$item.itemname}--></a>
						</td>
						<td id="price_<!--{$item.itemid}-->"><!--{getPrice($item.price)}--></td>
						<td><!--{$item.inventory}--></td>
						<td id='oper_<!--{$item.itemid}-->'>
							<a href="javascript:void(0);" onclick="window.parent.ItemSelect.add('<!--{$item.itemid}-->');return false;" class="select"></a>
						</td>
					</tr>
					<!--{/foreach}-->
				<!--{else}-->
					<tr align="center">
						<td colspan="6">暂无商品</td>
					</tr>
				<!--{/if}-->
			</tbody>
		</table>
		<!--{include_page("page.html","foot")}-->
</div>
</body>
</html>
<script type="text/javascript">
$(function(){
	var parentTbody = $(window.parent.document).find("#seltbody");
	$("tr",parentTbody).each(function(){
		var itemid = $(this).attr("id").replace("tr_","");
		$("#oper_"+itemid).html("<font color='red'>已添加</font>");
	});
});
</script>
